require 'lib/smppclient/pdu/tlv/tlv'
#require_relative 'tag'

module SmppClient

  module Pdu

    module Tlv

      # Sample Tlv which value 1 octet int.

      class SampleTlv < Tlv

        TAG = 0x5555

        attr_reader :value

        def initialize(arg)
          if arg.kind_of? ByteBuffer
            super(arg)
            @value = arg.remove_byte
          else
            super(TAG)
            @value = arg
          end
        end

        def value_bytes
          ByteBuffer.new.append_byte(value).bytes
        end

      end

    end

  end

end